package com.zds.scm.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zds.scm.common.CommonServlet;

public class CourseInfoServlet extends CommonServlet {

	private static final long serialVersionUID = 4475040933223556033L;
	public void insert(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		logger.debug("执行insert方法");
		//TODO 增加课程信息,并根据增加成功与否,执行相应的跳转
		//重定向到上下文路径中的登陆页面,转发时地址栏的信息会改变,request.setAttribute("", "");中设置的值，不能在重定向的页面访问
		//response.sendRedirect(request.getContextPath()+"/");  
		//转发到当前上下文路径的登陆页面,转发时地址栏的信息不变,request.setAttribute("", "");中设置的值，在可以在转发的页面中访问
		request.getRequestDispatcher("/").forward(request, response);
	}
	public void delete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		logger.debug("执行delete方法");
		//TODO 删除指定课程,根据成功与否,执行相应的跳转
	}
	public void update(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		logger.debug("执行update方法");
		//TODO 更新指定课程,根据成功与否,执行相应的跳转
	}
	public void findById(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		logger.debug("执行update方法");
		//TODO 根据传入的code查找课程详细信息,,根据成功与否,执行相应的跳转
	}
	public void findAll(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		logger.debug("执行update方法");
		//TODO 分页查询所有课程信息,根据成功与否,执行相应的跳转
	}
}
